-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: De-globalize JSAPI in IrisGrid package #1262
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall, just a little suggested cleanup.
@@ -251,6 +252,7 @@ export type FilterMap = Map< | |||
>; | |||
export interface IrisGridProps { | |||
children: React.ReactNode; | |||
dh: DhType; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Side note - it would be ideal if everything was abstracted through the model and we didn't have to depend on dh
being passed in to IrisGrid
. I think that change is much more work than we're looking for right now though with this change.
Also, we could still use the context in the class component to get the API from the context: https://legacy.reactjs.org/docs/context.html#classcontexttype
I don't think that's much better though.
packages/iris-grid/src/mousehandlers/IrisGridColumnSelectMouseHandler.ts
Outdated
Show resolved
Hide resolved
packages/iris-grid/src/sidebar/aggregations/AggregationEdit.tsx
Outdated
Show resolved
Hide resolved
aff5958
to
72fbc81
Compare
Codecov Report
@@ Coverage Diff @@
## main #1262 +/- ##
==========================================
+ Coverage 45.39% 45.43% +0.03%
==========================================
Files 502 502
Lines 34706 34764 +58
Branches 8677 8679 +2
==========================================
+ Hits 15754 15794 +40
- Misses 18901 18919 +18
Partials 51 51
Flags with carried forward coverage won't be shown. Click here to find out more.
|
72fbc81
to
f1f7f75
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, need to update the Breaking Change bit
Slightly confused how text in the Go To Row has gotten shifted down by a pixel
Updated breaking changes in the first comment. |
DateUtils
andTableUtils
in thejsapi-utils
package.dashboard-core-plugins
,code-studio
, embed-grid` to match the IrisGrid package changes.BREAKING CHANGE:
DateUtils
static methodsmakeDateWrapper
,getNextDate
,parseDateRange
now require the JSAPI object as the first argument.IrisGridUtils
static methodsdehydrateIrisGridState
,hydrateIrisGridState
,hydrateQuickFilters
,dehydrateAdvancedFilters
,hydrateAdvancedFilters
,dehydrateAdvancedFilterOptions
,hydrateAdvancedFilterOptions
,dehydratePendingDataMap
,hydratePendingDataMap
,dehydrateValue
,hydrateValue
,dehydrateDateTime
,hydrateDateTime
,hydrateLong
,hydrateSort
,applyTableSettings
,getFiltersFromInputFilters
,rangeSetFromRanges
converted to instance methods. Consumers now need to create anIrisGridUtils
instance and pass the JSAPI object to the constructor.TableUtils
static methodsmakeQuickFilter
,makeQuickFilterFromComponent
,makeQuickNumberFilter
,makeQuickTextFilter
,makeQuickBooleanFilter
,makeQuickDateFilter
,makeQuickDateFilterWithOperation
,makeQuickCharFilter
,makeAdvancedFilter
,makeAdvancedValueFilter
,makeFilterValue
,makeFilterRawValue
,makeValue
,makeSelectValueFilter
converted to instance methods. Consumers now need to create aTableUtils
instance and pass the JSAPI object to the constructor.IrisGridTableModel
,IrisGridTableModelTemplate
,IrisGridProxyModel
constructors require the JSAPI object in the first argument.IrisGridTestUtils.makeModel
,IrisGridModelFactory.makeModel
now require the JSAPI object in the first argument.IrisGridContextMenuHandler
constructor requires the JSAPI object in the second argument.IrisGridPanel
requires a newmakeApi
prop, a function that resolves with the JSAPI instance.CrossColumnSearch.createSearchFilter
requires the JSAPI object argument.AdvancedFilterCreatorSelectValue
,AdvancedFilterCreatorSelectValueList
,ChartBuilder
,GotoRow
,IrisGrid
,IrisGridModelUpdater
,IrisGridPartitionSelector
,PartitionSelectorSearch
,TableCSVExporter
,TableSaver
,TreeTableViewportUpdater
,RowFormatEditor
,ColumnFormatEditor
,ConditionEditor
now require the JSAPI object passed in the new propdh
.AdvancedFilterCreator
,AdvancedFilterCreatorFilterItem
require theTableUtils
instance pass in the new proptableUtils
.ConditionalFormattingUtils
static methodsgetFormatColumns
,isDateConditionValid
require the JSAPI object in the first argument.ConditionalFormattingAPIUtils
static methodmakeRowFormatColumn
requires the JSAPI object in the first argument.